A few remarks about efficiency and quirks:
\bullet
(•) in various sizes, rather than the default \picsquare
,
although the latter seems to have a better visual appearance. The
use a \picsquare
also enables one to have a better control over the
thickness of dots and lines.
A note on efficiency: when specifying a font or a fontsize for a character
it is more efficient to say:
{\tiny \dottedline[$\bullet$]{2}(0,0)(40,30)(80,10)}
, rather than
\dottedline[\tiny $\bullet$]{2}(0,0)(40,30)(80,10)
.
In the latter case, \tiny
macro gets invoked for each instance
of the dotcharacter $\bullet$
as the dottedline is plotted.
\drawline
command with a -ve
stretch be used instead of \dashline
, since the former is much more
cpu- and memory-efficient.
\dottedline
and \dashline
come out much too thin with
\thinlines
. Moreover, the thicker the \dashline
, fewer
``dots'' are required to construct dashes resulting in lesser memory and cpu
usage. Thus, it is recommended that they be plotted with \thicklines
in effect, or with a linethickness of about 1–2pt.
\drawline
, any explicit linethickness declarations
(i.e. using \linethickness
command) are ignored. The only applicable
declarations are \thinlines
and \thicklines
since line-segment
fonts are available in only two thicknesses.
Above commands are available in the picture environment only since they use many of the LATEX's predefined picture commands. Extensive use of some of the internal macros and variables of LATEX has been made for efficiency sake, even though that makes these macros vulnerable to future revisions of LATEX.
The dottedline macro gets complicated because TEX does not have any builtin
facility for floating point calculations or for calculating square-roots or
trigonometric functions. The inter-dot-gap in a dottedline has to be treated
as the actual distance between two dots along the ``hypotenuse'' and not its
projected distance along x-axis or y-axis, since the latter interpretation
would result in a different real inter-dot-gap for different slopes;
it would be incorrect if we were joining points on a graph. The dootedline
macro treats the inter-dot-gap as the actual distance between two dots and
draws the various segments of the ``curve'' with this distance fixed. The
macro accomplishes this by estimating the actual length of the line and the
number of segments of the specified distance that will fit between the two
end-points; a macro, namely, \sqrtandstuff
calculates this
square-root. Some algebraic relations are used in estimating this square-root
and are described in appendix A.
Beware, if far too many dots are put in one picture, LATEX will run out of
memory (box full), so be kind to it. For instance, by reducing the
inter-dot-gap to about 0.3mm in the case of a \dottedline
, one can get
essentially a solid line, but that would mean a LOT of dots and it may run
out of memory.
If many lines using above-mentioned macros are drawn, then a
\clearpage
ought to be put at judicious places in the document so as
to tell LATEX not to keep those figures floating – LATEX sometimes
keeps entire figures in memory while trying to figure out how and where to
lay them and it can frequently run out of memory. A \clearpage
may
prevent running out of memory and may reduce execution times.
In case of such a
memory-full error message, a \clearpage
in the region where the error
occurred should be attempted first and if that does not help then the number
of ``dots'' in the picture will have to be reduced.
A word about \drawline
is in order. LATEX's \line
command
takes an ordered pair of integers to specify the slope of the line where the
numbers are between -6 and 6 such that the least common divisor is 1. For
the \drawline
command, the given arbitrary slope has to be mapped to
the pair of integers representing the closest available slope.
Another macro, \lineslope
is used to accomplish this task. The macro
\lineslope
takes two arguments, the base and the height of the
triangle whose hypotenuse represents the line to be drawn and returns the
ordered pair of integers representing the closest slope; using a line segment
of that slope, a jagged line between the two specified end-points is then
constructed. More details can be found in the macro file epic.sty.
As noted earlier, the command \jput
behaves identically as \put
when not in any of the join environments. The author considered obliterating
the \put
command too radical a step. Also, there should have been a
command \jputfile
corresponding to the \jput
command (like the
\putfile
command) but that was considered unnecessary since typically
the number of coordinates plotted in a join environment would be an order
less than what might be the case with \putfile
and can be easily
typed explicitly in the document using \jput
commands.
However, if it is desired to have all the \put
commands treated as
though they were \jput
, the following declaration may be used:
\let\put\jput
Above declaration will make all
the \put
commands be treated as \jput
; in particular,
\putfile
command would then behave as though it were a
\jputfile
when in any of the join environments. However, it is
suggested that such ``tricks'' be used with care.
Finally, commands to plot vectors of arbitrary slopes have not been
implemented. One way to plot them is to plot a line, and subsequently plot a
\vector
of appropriate slopes and length zero at the required place.
Following pages contain some examples. The test-sample picture for
\drawline
command (Figure 2) is also about the maximum amount of
objects that one can put in one picture. Older versions of TEX and LATEX may not be able to print pictures of this size.
picman-fig1
picman-fig3